//
//  JourneyCollectionCell.m
//  WhereToTravel
//
//  Created by dlios on 15/10/14.
//  Copyright © 2015年 zhoushengmin. All rights reserved.
//

#import "JourneyCollectionCell.h"

#define W self.contentView.frame.size.width
#define H self.contentView.frame.size.height

@implementation JourneyCollectionCell

-(instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView {
    [super createView];
    self.upImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.upImageView];
    
    self.downLabel.font = [UIFont systemFontOfSize:12];
}

- (void)layoutSubviews {
    self.upImageView.frame = CGRectMake(W * 0.05, H * 0.05, W * 0.9, H * 0.8);
    self.downLabel.frame = CGRectMake(W * 0.05, H * 0.85, W * 0.9, H * 0.1);
    [self.upImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(H * 0.05);
        make.left.equalTo(self.mas_left).offset(W * 0.05);
        make.right.equalTo(self.mas_left).offset(W * 0.95);
        make.bottom.equalTo(self.mas_top).offset(H * 0.8);
    }];
    [self.downLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(H * 0.85);
        make.left.equalTo(self.upImageView.mas_left);
        make.right.equalTo(self.mas_left).offset(W * 0.95);
        make.bottom.equalTo(self.mas_top).offset(H * 0.95);
    }];
}


@end
